<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ page trimDirectiveWhitespaces="true"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<c:set var="root" value="<%=request.getContextPath()%>" />
<a class="menu-toggler" id="menu-toggler" href="javascript:void(0)"> <span class="menu-text"></span>
</a>
<style>
.Three-Dee {
	font-family: Garamond, serif;
	line-height: 1em;
	color: #ffcc00;
	font-weight: bold;
	font-size: 15px;
	text-shadow: 0px 0px 0 rgb(202, 151, -53), 1px 1px 0 rgb(158, 107, -97),
		2px 2px 0 rgb(115, 64, -140), 3px 3px 2px rgba(0, 0, 0, 0.6), 3px 3px
		1px rgba(0, 0, 0, 0.5), 0px 0px 2px rgba(0, 0, 0, .2);
}
</style>
<div class="sidebar" id="sidebar">
	<script type="text/javascript">
		var log = function(msg) {
			console.log(msg);
		};
		try {
			ace.settings.check('sidebar', 'fixed')
		} catch (e) {
		}
	</script>

	<div class="sidebar-shortcuts" id="sidebar-shortcuts">
		<div class="sidebar-shortcuts-large" id="sidebar-shortcuts-large">
			<span class="Three-Dee">${config.name}</span>
		</div>
		<div class="sidebar-shortcuts-mini" id="sidebar-shortcuts-mini">
			<span class="btn btn-success"></span> <span class="btn btn-info"></span> <span class="btn btn-warning"></span> <span class="btn btn-danger"></span>
		</div>
	</div>
	<!-- #sidebar-shortcuts -->
	<ul class="nav nav-list">
		<li id="nav01" class='active' onclick="trans('/main','','',this);"><a href="javascript:void(0)"> <i class="icon-home"></i> <span class="menu-text"> 首页 </span>
		</a></li>
		<c:if test="${sessionScope['ABKJ-PT-ACCOUNT'].type ==1}">
			<li id="nav02"><a href="javascript:void(0)" class="dropdown-toggle"> <i class="icon-cog"></i> <span class="menu-text"> 系统管理 </span> <b class="arrow icon-angle-down"></b>
			</a>
				<ul class="submenu">
					<li id="menu-user-mana" onclick="trans('/system/user','系统管理－用户管理','nav02',this);"><a href="javascript:void(0)"> <i class="icon-leaf"></i> 用户管理
					</a></li>
					<li id="menu-user-log" onclick="trans('/system/userlog','系统管理－用户日志','nav02',this);"><a href="javascript:void(0)"> <i class="icon-leaf"></i> 用户日志
					</a></li>
					<li id="menu-user-log" onclick="trans('/system/smsSetting','系统管理－短信预警','nav02',this);"><a href="javascript:void(0)"> <i class="icon-leaf"></i> 短信预警
					</a></li>
					<li id="menu-user-log" onclick="trans('/system/alertSetting','系统管理－报警管理','nav02',this);"><a href="javascript:void(0)"> <i class="icon-leaf"></i> 报警管理
					</a></li>
				</ul></li>
		</c:if>
		<li id="nav03"><a href="javascript:void(0)" class="dropdown-toggle"> <i class="icon-list"></i> <span class="menu-text"> 监测点管理 </span> <b class="arrow icon-angle-down"></b>
		</a>
			<ul class="submenu">
				<li id="menu-area-mana" onclick="trans('/sensor/osmometer','监测点管理－渗压计(浸润线)','nav03',this);"><a href="javascript:void(0)"> <i class="icon-leaf"></i> 渗压传感器
				</a></li>
				<li id="menu-property-mana" onclick="trans('/sensor/level','监测点管理－静力水准仪','nav03',this);"><a href="javascript:void(0)"> <i class="icon-double-angle-right"></i> 静力水准仪
				</a></li>
				<li id="menu-scaner-pepo" onclick="trans('/sensor/ultrasonic','监测点管理－超声波液位仪','nav03',this);"><a href="javascript:void(0)"> <i class="icon-leaf"></i> 超声波液位仪
				</a></li>
				<li id="menu-scaner-rain" onclick="trans('/sensor/rain','监测点管理－雨量计','nav03',this);"><a href="javascript:void(0)"> <i class="icon-leaf"></i> 雨量计
				</a></li>
				<li id="menu-scaner-rain" onclick="trans('/sensor/displacement','监测点管理－位移计','nav03',this);"><a href="javascript:void(0)"> <i class="icon-double-angle-right"></i> 位移计
				</a></li>
			</ul></li>
		<li id="nav04"><a href="javascript:void(0)" class="dropdown-toggle"> <i class=" icon-table"></i> <span class="menu-text"> 数据监测分析</span> <b class="arrow icon-angle-down"></b>
		</a>
			<ul class="submenu">
				<li id="menu-stati-osmometer" onclick="trans('/analysis/osmometer','数据监测分析-浸润线','nav04',this);"><a href="javascript:void(0)"> <i class="icon-double-angle-right"></i> 浸润线
				</a></li>
				<li id="menu-stati-exception" onclick="trans('/analysis/level','数据监测分析－表面垂直位移','nav04',this);"><a href="javascript:void(0)"> <i class="icon-double-angle-right"></i> 表面垂直位移
				</a></li>
				<li id="menu-stati-total" onclick="trans('/analysis/ultrasonic','数据监测分析－库水位与干滩','nav04',this);"><a href="javascript:void(0)"> <i class="icon-double-angle-right"></i> 库水位与干滩
				</a></li>
				<li id="menu-stati-rain" onclick="trans('/history/rain','数据监测分析－降雨量','nav04',this);"><a href="javascript:void(0)"> <i class="icon-double-angle-right"></i> 降雨量
				</a></li>
				<li id="menu-stati-displacement" onclick="trans('/analysis/displacement','数据监测分析－边坡移动距离','nav04',this);"><a href="javascript:void(0)"> <i class="icon-double-angle-right"></i> 边坡移动距离
				</a></li>
			</ul></li>
		<li id="nav05"><a href="javascript:void(0)" class="dropdown-toggle"> <i class=" icon-dashboard"></i> <span class="menu-text"> 历史数据分析</span> <b class="arrow icon-angle-down"></b>
		</a>
			<ul class="submenu">
				<li id="menu-stati-history" onclick="trans('/history/osmometer','历史数据分析-渗压传感器','nav05',this);"><a href="javascript:void(0)"> <i class="icon-double-angle-right"></i> 渗压传感器
				</a></li>
				<li id="menu-stati-history" onclick="trans('/history/level','历史数据分析-静力水准仪','nav05',this);"><a href="javascript:void(0)"> <i class="icon-double-angle-right"></i> 静力水准仪
				</a></li>
				<li id="menu-stati-history" onclick="trans('/history/ultrasonic','历史数据分析-超声波液位仪','nav05',this);"><a href="javascript:void(0)"> <i class="icon-double-angle-right"></i> 超声波液位仪
				</a></li>
				<li id="menu-stati-history" onclick="trans('/history/rain','历史数据分析-雨量计','nav05',this);"><a href="javascript:void(0)"> <i class="icon-double-angle-right"></i> 雨量计
				</a></li>
				<li id="menu-stati-history" onclick="trans('/history/displacement','历史数据分析-位移计','nav05',this);"><a href="javascript:void(0)"> <i class="icon-double-angle-right"></i> 位移计
				</a></li>
			</ul></li>
	</ul>
	<div class="sidebar-collapse" id="sidebar-collapse">
		<i class="icon-double-angle-left" data-icon1="icon-double-angle-left" data-icon2="icon-double-angle-right"></i>
	</div>
	<script type="text/javascript">
		try {
			ace.settings.check('sidebar', 'collapsed')
		} catch (e) {
		}
		function trans(url, txt, o, a) {
			//setMessageFunction(url);
			$('#tabs2').tabs({
				active : 0
			});
			$('#ui-id-1').empty();
			console.log(txt == '');
			$('#ui-id-1').append(txt == '' ? "&nbsp;首页" : "&nbsp;" + txt);

			url = "${root}" + url;
			pt.menu_change(o, a);
			reload(true);
			$.ajax({
				contentType : "application/x-www-form-urlencoded; charset=utf-8",
				type : 'get',
				url : url + '?random=' + Math.random(),
				success : function(data) {
					reload(false);
					$('#content-container').empty();
					$('#content-container').replaceWith("<div id=\"content-container\">" + data + "</div>");
				},
				error : function(req) {
					reload(false);
					$('#content-container').empty();
					$('#content-container').replaceWith("<div id=\"content-container\">" + alertMsg + "</div>");
				},
				complete : function(XHR, TS) {
					XHR = null
				}
			});
		}
		function trans2(url, txt, param, fun) {
			//setMessageFunction(url);
			if (url.indexOf('?') != -1) {
				url = url + '&random=' + Math.random();
			} else {
				url = url + '?random=' + Math.random();
			}
			url = "${root}" + url;
			reload(true);
			$.ajax({
				contentType : "application/x-www-form-urlencoded; charset=utf-8",
				data : param,
				type : 'post',
				url : url,
				success : function(data) {
					reload(false);
					$('#content-container').replaceWith("<div id=\"content-container\">" + data + "</div>");
					if (undefined != fun) {
						fun();
					}
				},
				error : function(req) {
					reload(false);
					$('#content-container').replaceWith("<div id=\"content-container\">" + req + "</div>");
				},
				complete : function(XHR, TS) {
					XHR = null
				}
			});
		}

		function reload(state) {
			if (state) {
				$("#refesh").attr("style", "display:block");
			} else {
				$("#refesh").attr("style", "display:none");
			}
		}

		function ajaxSubmit(url, param, type, call, errFun) {
			url = "${root}" + url;
			if (param == null || param == '') {
				param = "random=" + Math.random();
			} else {
				var isjson = typeof (param) == "object" && Object.prototype.toString.call(param).toLowerCase() == "[object object]" && !param.length;
				if (isjson) {
					param["random"] = Math.random();
				} else {
					param = param + "&random=" + Math.random();
				}
			}
			$.ajax({
				contentType : "application/x-www-form-urlencoded; charset=utf-8",
				data : param,
				type : type,
				url : url,
				success : call,
				error : function(req) {
					if (undefined == errFun) {
						$('#content-container').empty();
						$('#content-container').append("操作异常，请重试！");
					} else {
						errFun();
					}

				},
				complete : function(XHR, TS) {
					XHR = null
				}
			});
		}
	</script>
</div>
